Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-glob

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-glob

Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet

  • 3.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11M
decreased by-80.49%
Maintainers
2
Weekly downloads
 
Created

What is is-glob?

The is-glob npm package is used to determine if a string is a glob pattern. A glob pattern is a string that defines a pattern for matching file names, typically used for file searching and manipulation. The package provides a simple API to check if a string contains characters that make it a valid glob pattern.

What are is-glob's main functionalities?

Check if a string is a glob pattern

This feature allows you to check if a given string is a glob pattern. It returns true if the string contains special characters like '*', '?', or '[...]' that are used in glob patterns, and false otherwise.

const isGlob = require('is-glob');

console.log(isGlob('*.js')); // true
console.log(isGlob('hello.txt')); // false

Check if an array contains a glob pattern

This feature checks if any element in an array is a glob pattern. It returns true if at least one element is a glob pattern, and false if none are.

const isGlob = require('is-glob');

console.log(isGlob(['css', '*.js'])); // true
console.log(isGlob(['css', 'js'])); // false

Other packages similar to is-glob

Keywords

FAQs

Package last updated on 12 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc